import api from '../index'
import tools from '@/tools'

// 查询modeler列表
export const listDefinition = (params) => {
  const url = '/vapi/activity/processDefinition/list'
  return api.get(url,params)
}

// 查询审批详细
export const getDefinitionsByInstanceId = (instanceId) => {
  const url = '/vapi/activity/processDefinition/getDefinitions/${instanceId}'
  return api.get(url)
}

// 挂起激活转换
export const suspendOrActiveApply = (data) => {
  const url = '/vapi/activity/processDefinition/suspendOrActiveApply/'
  return api.post(url,data)
}

// 删除Modeler
export const delDefinition = (id) => {
  const url = '/vapi/activity/processDefinition/remove/'+id
  return api.delete(url)
}

// //获取字典
// export const getDicts = (dictType) => {
//   const url = '/vapi/activity/actdict/data/type/'+dictType
//   return api.get(url)
// }

//查询审批详细
export const getActivitiDetail = (deploymentId) => {
  const url = '/vapi/activity/processDefinition/getDefinitionXML?deploymentId='+deploymentId+'&resourceName=.bpmn'
  return api.get(url)
}


//查询该部门下有多少审批流
export const listByOrgId = (deploymentId) => {
  const url = '/vapi/activity/processDefinition/listByOrgId?deptId='+deploymentId
  return api.get(url)
}